package de.uulm.vs.timeserverv3;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * Created by wymaoxiaoliang on 2017/3/2.
 */
public class TimeEncoderV2 extends MessageToByteEncoder<UnixTime> {
    @Override
    protected void encode(ChannelHandlerContext ctx, UnixTime msg, ByteBuf out) {
        System.out.println("TimeEncoderV2: " + msg);
        out.writeInt((int) msg.value());
    }
}
